package com.example.rabbitmq.controller.quorum;

import com.example.rabbitmq.Constants;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/producer")
public class QuorumProducerController {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @RequestMapping("/quorum")
    public String quorum() {
        rabbitTemplate.convertAndSend(Constants.QUORUM_EXCHANGE,"quorum","quorum test...");
        return "发送消息成功";
    }
}
